package cn.lg.soar.mvc.model;

import java.util.Objects;

/**
 * @author luguoxiang 469599794@qq.com
 * @Date: 2023/11/22 23:43
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
public class ClientInfo<T> {

    private final String clientId;

    private final T client;

    public ClientInfo(String clientId, T client) {
        this.clientId = clientId;
        this.client = client;
    }

    public String getClientId() {
        return clientId;
    }

    public T getClient() {
        return client;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ClientInfo<?> that = (ClientInfo<?>) o;
        return Objects.equals(clientId, that.clientId) || Objects.equals(client, that.client);
    }

    @Override
    public int hashCode() {
        return Objects.hash(clientId);
    }
}
